package cn.ronghui.project.types.enums;

import lombok.Getter;

@Getter
public enum AppliStatusEnumVO {
    PENDING_APPROVAL("pending_approval","待审核"),
    APPROVED("approved","已批准"),
    REJECTED("rejected","已拒绝"),
    ;
    private String code;
    private String info;

    AppliStatusEnumVO(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public static AppliStatusEnumVO getAppliStatusEnum(String value){
        switch (value){
            case "待审核":
                return PENDING_APPROVAL;
            case "已批准":
                return APPROVED;
            case "已拒绝":
                return REJECTED;
            default:
                throw new RuntimeException("参数错误");
        }
    }
}
